window.__require = function e(t, o, c) {
    function s(i, r) {
        if (!o[i]) {
            if (!t[i]) {
                var l = i.split("/");
                if (l = l[l.length - 1], !t[l]) {
                    var a = "function" == typeof __require && __require;
                    if (!r && a) return a(l, !0);
                    if (n) return n(l, !0);
                    throw new Error("Cannot find module '" + i + "'")
                }
                i = l
            }
            var u = o[i] = {
                exports: {}
            };
            t[i][0].call(u.exports, function (e) {
                return s(t[i][1][e] || e)
            }, u, u.exports, e, t, o, c)
        }
        return o[i].exports
    }
    for (var n = "function" == typeof __require && __require, i = 0; i < c.length; i++) s(c[i]);
    return s
}({
    Toast: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "7ee545TBOdEBJAb9ldtC0aM", "Toast");
        var c = this && this.__extends || function () {
                var e = function (t, o) {
                    return (e = Object.setPrototypeOf || {
                            __proto__: []
                        }
                        instanceof Array && function (e, t) {
                            e.__proto__ = t
                        } || function (e, t) {
                            for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o])
                        })(t, o)
                };
                return function (t, o) {
                    function c() {
                        this.constructor = t
                    }
                    e(t, o), t.prototype = null === o ? Object.create(o) : (c.prototype = o.prototype, new c)
                }
            }(),
            s = this && this.__decorate || function (e, t, o, c) {
                var s, n = arguments.length,
                    i = n < 3 ? t : null === c ? c = Object.getOwnPropertyDescriptor(t, o) : c;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, c);
                else
                    for (var r = e.length - 1; r >= 0; r--)(s = e[r]) && (i = (n < 3 ? s(i) : n > 3 ? s(t, o, i) : s(t, o)) || i);
                return n > 3 && i && Object.defineProperty(t, o, i), i
            };
        Object.defineProperty(o, "__esModule", {
            value: !0
        });
        var n = cc._decorator,
            i = n.ccclass,
            r = n.property,
            l = function (e) {
                function t() {
                    var t = null !== e && e.apply(this, arguments) || this;
                    return t.label = null, t
                }
                return c(t, e), t.prototype.start = function () {}, t.prototype.show = function (e) {
                    this.label.string = e, this.node.active = !0, this.scheduleOnce(function () {
                        this.node.active = !1
                    }, 1)
                }, s([r(cc.Label)], t.prototype, "label", void 0), t = s([i], t)
            }(cc.Component);
        o.default = l, cc._RF.pop()
    }, {}],
    rank: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "e8830RYJqVPJ5Y3HKvsqpWM", "rank");
        var c = this && this.__extends || function () {
                var e = function (t, o) {
                    return (e = Object.setPrototypeOf || {
                            __proto__: []
                        }
                        instanceof Array && function (e, t) {
                            e.__proto__ = t
                        } || function (e, t) {
                            for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o])
                        })(t, o)
                };
                return function (t, o) {
                    function c() {
                        this.constructor = t
                    }
                    e(t, o), t.prototype = null === o ? Object.create(o) : (c.prototype = o.prototype, new c)
                }
            }(),
            s = this && this.__decorate || function (e, t, o, c) {
                var s, n = arguments.length,
                    i = n < 3 ? t : null === c ? c = Object.getOwnPropertyDescriptor(t, o) : c;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, c);
                else
                    for (var r = e.length - 1; r >= 0; r--)(s = e[r]) && (i = (n < 3 ? s(i) : n > 3 ? s(t, o, i) : s(t, o)) || i);
                return n > 3 && i && Object.defineProperty(t, o, i), i
            };
        Object.defineProperty(o, "__esModule", {
            value: !0
        });
        var n = cc._decorator,
            i = n.ccclass,
            r = (n.property, function (e) {
                function t() {
                    return null !== e && e.apply(this, arguments) || this
                }
                return c(t, e), t.prototype.start = function () {}, t.prototype.close = function () {
                    this.node.active = !1
                }, t = s([i], t)
            }(cc.Component));
        o.default = r, cc._RF.pop()
    }, {}],
    selectLevel: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "f576dkVJnJM679Pri9I8O7r", "selectLevel");
        var c = this && this.__extends || function () {
                var e = function (t, o) {
                    return (e = Object.setPrototypeOf || {
                            __proto__: []
                        }
                        instanceof Array && function (e, t) {
                            e.__proto__ = t
                        } || function (e, t) {
                            for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o])
                        })(t, o)
                };
                return function (t, o) {
                    function c() {
                        this.constructor = t
                    }
                    e(t, o), t.prototype = null === o ? Object.create(o) : (c.prototype = o.prototype, new c)
                }
            }(),
            s = this && this.__decorate || function (e, t, o, c) {
                var s, n = arguments.length,
                    i = n < 3 ? t : null === c ? c = Object.getOwnPropertyDescriptor(t, o) : c;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, c);
                else
                    for (var r = e.length - 1; r >= 0; r--)(s = e[r]) && (i = (n < 3 ? s(i) : n > 3 ? s(t, o, i) : s(t, o)) || i);
                return n > 3 && i && Object.defineProperty(t, o, i), i
            };
        Object.defineProperty(o, "__esModule", {
            value: !0
        });
        var n = cc._decorator,
            i = n.ccclass,
            r = n.property,
            l = function (e) {
                function t() {
                    var t = null !== e && e.apply(this, arguments) || this;
                    return t.toggle1 = null, t.toggle2 = null, t.toggle3 = null, t.closeBtn = null, t.game = null, t
                }
                return c(t, e), t.prototype.start = function () {}, t.prototype.startGame = function () {
                    var e = "\u7b80\u5355";
                    this.toggle1.isChecked ? e = "\u7b80\u5355" : this.toggle2.isChecked ? e = "\u666e\u901a" : this.toggle3.isChecked && (e = "\u56f0\u96be"), this.node.parent.getComponent("wss_ps_PopStar").gameStart(e), this.close()
                }, t.prototype.close = function () {
                    this.node.active = !1
                }, s([r(cc.Toggle)], t.prototype, "toggle1", void 0), s([r(cc.Toggle)], t.prototype, "toggle2", void 0), s([r(cc.Toggle)], t.prototype, "toggle3", void 0), s([r(cc.Button)], t.prototype, "closeBtn", void 0), t = s([i], t)
            }(cc.Component);
        o.default = l, cc._RF.pop()
    }, {}],
    setting: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "3bb57cZdJ9Od5pEnJvpAXNs", "setting");
        var c = this && this.__extends || function () {
                var e = function (t, o) {
                    return (e = Object.setPrototypeOf || {
                            __proto__: []
                        }
                        instanceof Array && function (e, t) {
                            e.__proto__ = t
                        } || function (e, t) {
                            for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o])
                        })(t, o)
                };
                return function (t, o) {
                    function c() {
                        this.constructor = t
                    }
                    e(t, o), t.prototype = null === o ? Object.create(o) : (c.prototype = o.prototype, new c)
                }
            }(),
            s = this && this.__decorate || function (e, t, o, c) {
                var s, n = arguments.length,
                    i = n < 3 ? t : null === c ? c = Object.getOwnPropertyDescriptor(t, o) : c;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, c);
                else
                    for (var r = e.length - 1; r >= 0; r--)(s = e[r]) && (i = (n < 3 ? s(i) : n > 3 ? s(t, o, i) : s(t, o)) || i);
                return n > 3 && i && Object.defineProperty(t, o, i), i
            };
        Object.defineProperty(o, "__esModule", {
            value: !0
        });
        var n = cc._decorator,
            i = n.ccclass,
            r = n.property,
            l = function (e) {
                function t() {
                    var t = null !== e && e.apply(this, arguments) || this;
                    return t.on = null, t.off = null, t.btnBg = null, t.btnVoice = null, t.hasBg = null, t.hasVoice = null, t
                }
                return c(t, e), t.prototype.start = function () {}, t.prototype.show = function () {
                    this.node.active = !0, this.hasBg = cc.sys.localStorage.getItem("bg"), console.log("QQQ hasBg", this.hasBg), null == this.hasBg || void 0 == this.hasBg || 1 == this.hasBg ? (console.log("QQQ hasBg", "111"), this.btnBg.getComponent(cc.Sprite).spriteFrame = this.on) : (console.log("QQQ hasBg", "222"), this.btnBg.getComponent(cc.Sprite).spriteFrame = this.off), this.hasVoice = cc.sys.localStorage.getItem("voice"), console.log("QQQ hasVoice", this.hasVoice), null == this.hasVoice || void 0 == this.hasVoice || 1 == this.hasVoice ? (this.btnVoice.getComponent(cc.Sprite).spriteFrame = this.on, this.node.parent.getComponent("wss_ps_PopStar").hasVoice = !0) : (this.btnVoice.getComponent(cc.Sprite).spriteFrame = this.off, this.node.parent.getComponent("wss_ps_PopStar").hasVoice = !1)
                }, t.prototype.onBgClick = function () {
                    null == this.hasBg || void 0 == this.hasBg || 1 == this.hasBg ? (this.btnBg.node.getComponent(cc.Sprite).spriteFrame = this.off, cc.sys.localStorage.setItem("bg", 0), this.hasBg = 0, this.node.parent.getComponent("wss_ps_PopStar").voice.getComponent("voice").closeBG()) : (this.hasBg = 1, this.btnBg.node.getComponent(cc.Sprite).spriteFrame = this.on, cc.sys.localStorage.setItem("bg", 1), this.node.parent.getComponent("wss_ps_PopStar").voice.getComponent("voice").openBG())
                }, t.prototype.onVoiceClick = function () {
                    null == this.hasVoice || void 0 == this.hasVoice || 1 == this.hasVoice ? (this.btnVoice.node.getComponent(cc.Sprite).spriteFrame = this.off, this.node.parent.getComponent("wss_ps_PopStar").hasVoice = !1, cc.sys.localStorage.setItem("voice", 0), this.hasVoice = 0) : (this.btnVoice.node.getComponent(cc.Sprite).spriteFrame = this.on, this.node.parent.getComponent("wss_ps_PopStar").hasVoice = !0, cc.sys.localStorage.setItem("voice", 1), this.hasVoice = 1)
                }, t.prototype.close = function () {
                    this.node.active = !1
                }, s([r(cc.SpriteFrame)], t.prototype, "on", void 0), s([r(cc.SpriteFrame)], t.prototype, "off", void 0), s([r(cc.Button)], t.prototype, "btnBg", void 0), s([r(cc.Button)], t.prototype, "btnVoice", void 0), t = s([i], t)
            }(cc.Component);
        o.default = l, cc._RF.pop()
    }, {}],
    voice: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "57488fVBSZKpb5uQu3AdQM+", "voice");
        var c = this && this.__extends || function () {
                var e = function (t, o) {
                    return (e = Object.setPrototypeOf || {
                            __proto__: []
                        }
                        instanceof Array && function (e, t) {
                            e.__proto__ = t
                        } || function (e, t) {
                            for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o])
                        })(t, o)
                };
                return function (t, o) {
                    function c() {
                        this.constructor = t
                    }
                    e(t, o), t.prototype = null === o ? Object.create(o) : (c.prototype = o.prototype, new c)
                }
            }(),
            s = this && this.__decorate || function (e, t, o, c) {
                var s, n = arguments.length,
                    i = n < 3 ? t : null === c ? c = Object.getOwnPropertyDescriptor(t, o) : c;
                if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, o, c);
                else
                    for (var r = e.length - 1; r >= 0; r--)(s = e[r]) && (i = (n < 3 ? s(i) : n > 3 ? s(t, o, i) : s(t, o)) || i);
                return n > 3 && i && Object.defineProperty(t, o, i), i
            };
        Object.defineProperty(o, "__esModule", {
            value: !0
        });
        var n = cc._decorator,
            i = n.ccclass,
            r = n.property,
            l = function (e) {
                function t() {
                    var t = null !== e && e.apply(this, arguments) || this;
                    return t.bg = null, t.resid = null, t
                }
                return c(t, e), t.prototype.onLoad = function () {
                    var e = cc.sys.localStorage.getItem("bg");
                    console.log("QQQ hasBg", e), null != e && void 0 != e && 1 != e || (console.log("QQQ hasBg", "111"), this.resid = cc.audioEngine.play(this.bg, !0, 1));
                    var t = cc.sys.localStorage.getItem("voice");
                    this.node.parent.getComponent("wss_ps_PopStar").hasVoice = null == t || void 0 == t || 1 == t
                }, t.prototype.start = function () {}, t.prototype.closeBG = function () {
                    cc.sys.localStorage.setItem("bg", 0), cc.audioEngine.stop(this.resid)
                }, t.prototype.openBG = function () {
                    cc.sys.localStorage.setItem("bg", 1), this.resid = cc.audioEngine.play(this.bg, !0, 1)
                }, s([r({
                    type: cc.AudioClip
                })], t.prototype, "bg", void 0), t = s([i], t)
            }(cc.Component);
        o.default = l, cc._RF.pop()
    }, {}],
    wss_ps_Cube: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "50ef5nPHVRAGr8Mag9mJCZA", "wss_ps_Cube"), cc.Class({
            extends: cc.Component,
            properties: {
                cubeType: 0,
                cubeRow: 0,
                cubeCol: 0,
                alreadyRet: !1,
                willRemove: !1
            },
            start: function () {},
            setCubeType: function (e, t, o) {
                this.cubeType = e, this.cubeRow = t, this.cubeCol = o;
                var c = this,
                    s = "";
                0 == e ? s = "popstar/ps2_block_green" : 1 == e ? s = "popstar/ps2_block_red" : 2 == e ? s = "popstar/ps2_block_yellow" : 3 == e ? s = "popstar/ps2_block_purple" : 4 == e && (s = "popstar/ps2_block_blue"), cc.loader.loadRes(s, cc.SpriteFrame, function (e, t) {
                    e ? cc.error(e.message || e) : c.getComponent(cc.Sprite).spriteFrame = t
                }), this.addTouchEvent()
            },
            change: function (e) {
                var t = Math.random() * e | 0;
                this.cubeType = t;
                var o = this,
                    c = "";
                0 == t ? c = "popstar/ps2_block_green" : 1 == t ? c = "popstar/ps2_block_red" : 2 == t ? c = "popstar/ps2_block_yellow" : 3 == t ? c = "popstar/ps2_block_purple" : 4 == t && (c = "popstar/ps2_block_blue"), cc.loader.loadRes(c, cc.SpriteFrame, function (e, t) {
                    e ? cc.error(e.message || e) : o.getComponent(cc.Sprite).spriteFrame = t
                })
            },
            setSrcPos: function (e) {},
            setDestPos: function (e) {},
            addTouchEvent: function () {
                this.node.on("touchend", function () {
                    cc.log("addTouchEvent ---------\x3e touchend.")
                })
            },
            resetState: function () {
                this.alreadyRet = !1, this.willRemove = !1
            },
            resetRowCol: function (e, t) {
                this.cubeRow = e, this.cubeCol = t
            }
        }), cc._RF.pop()
    }, {}],
    wss_ps_PopStar: [function (e, t, o) {
        "use strict";
        cc._RF.push(t, "a2412hdFCJGL7Dkyn5iNekc", "wss_ps_PopStar"), cc.Class({
            extends: cc.Component,
            properties: {
                mainMenu: cc.Node,
                gameScene: cc.Node,
                endLess: cc.Node,
                btnStart: cc.Button,
                btnExit: cc.Button,
                btnBack: cc.Button,
                btnBack2: cc.Button,
                btnRetry: cc.Button,
                labelLevel: cc.Label,
                labelTotalScore: cc.Label,
                labelScore: cc.Label,
                labelNext: cc.Node,
                cubePrefab: cc.Prefab,
                lowerLeft: cc.v2(-324, -454),
                cubeWidth: 72,
                cubeHeight: 72,
                rowNum: 10,
                colNum: 10,
                allCube: [],
                posMatrix: [],
                curType: 0,
                removeCount: 0,
                curLevel: 1,
                totalScore: 0,
                curScore: 0,
                colorType: 3,
                slelctLevel: cc.Node,
                fullScore: 0,
                voice: cc.Node,
                settingNode: cc.Node,
                rangeNode: cc.Node,
                deleteBtn: cc.Button,
                changeBtn: cc.Button,
                resetBtn: cc.Button,
                deleteNum: 1,
                resetNum: 1,
                changeNum: 1,
                currentStatus: null,
                deleteOnce: {
                    type: cc.AudioClip,
                    default: null
                },
                audio6: {
                    type: cc.AudioClip,
                    default: null
                },
                audio7: {
                    type: cc.AudioClip,
                    default: null
                },
                audio8: {
                    type: cc.AudioClip,
                    default: null
                },
                toast: cc.Node,
                hasVoice: !1
            },
            start: function () {
                this.btnStart.node.on("click", this.showSelectLevel, this), this.btnExit.node.on("click", this.gameExit, this), this.btnBack.node.on("click", this.gameBack, this), this.btnBack2.node.on("click", this.gameBack2, this), this.btnRetry.node.on("click", this.gameRetry, this);
                var e = cc.view.getVisibleSize().width / 2;
                this.lowerLeft = cc.v2(43 - e, -454), cc.sys.platform == cc.sys.WECHAT_GAME && wx.getOpenDataContext().postMessage({
                    message: "message",
                    type: 0
                })
            },
            showSelectLevel: function () {
                this.slelctLevel.active = !0
            },
            gameStart: function (e) {
                cc.log("popstar gameStart"), "\u7b80\u5355" == e ? (this.rowNum = 10, this.colNum = 10, this.colorType = 3) : "\u666e\u901a" == e ? (this.rowNum = 10, this.colNum = 10, this.colorType = 4) : "\u56f0\u96be" == e && (this.rowNum = 10, this.colNum = 10, this.colorType = 5), this.deleteNum = 1, this.resetNum = 1, this.changeNum = 1, this.cubeWidth = cc.view.getVisibleSize().width / this.rowNum - 2, this.cubeHeight = this.cubeWidth, this.mainMenu.active = !1, this.gameScene.active = !0, this.endLess.active = !1, this.deleteBtn.instantiate = !0, this.deleteBtn.node.getChildByName("deleteLabel").getComponent(cc.Label).string = 1, this.changeBtn.instantiate = !0, this.changeBtn.node.getChildByName("changeLabel").getComponent(cc.Label).string = 1, this.resetBtn.instantiate = !0, this.resetBtn.node.getChildByName("resetLabel").getComponent(cc.Label).string = 1, this.createAllCube()
            },
            delete: function () {
                "1" == this.deleteBtn.node.getChildByName("deleteLabel").getComponent(cc.Label).string ? "delete" == this.currentStatus ? this.currentStatus = null : this.currentStatus = "delete" : this.toast.getComponent("Toast").show("\u9053\u5177\u4e0d\u8db3")
            },
            reset: function () {
                if ("1" == this.resetBtn.node.getChildByName("resetLabel").getComponent(cc.Label).string) {
                    for (var e = 0; e < this.rowNum; e++)
                        for (var t = 0; t < this.colNum; t++) {
                            var o = this.allCube[e][t];
                            if (null != o) o.getComponent("wss_ps_Cube").change(this.colorType)
                        }
                    this.resetBtn.node.getChildByName("resetLabel").getComponent(cc.Label).string = 0, this.resetBtn.instantiate = !1
                } else this.toast.getComponent("Toast").show("\u9053\u5177\u4e0d\u8db3")
            },
            showSettingNode: function () {
                this.settingNode.getComponent("setting").show()
            },
            showRangeNode: function () {
                this.rangeNode.active = !0, cc.sys.platform == cc.sys.WECHAT_GAME && wx.getOpenDataContext().postMessage({
                    message: "message",
                    type: 0
                })
            },
            change: function () {
                "1" == this.changeBtn.node.getChildByName("changeLabel").getComponent(cc.Label).string ? "change" == this.currentStatus ? this.currentStatus = null : this.currentStatus = "change" : this.toast.getComponent("Toast").show("\u9053\u5177\u4e0d\u8db3")
            },
            gameExit: function () {
                cc.log("popstar gameExit"), cc.director.loadScene("wss_SelectGame")
            },
            gameBack: function () {
                cc.log("popstar gameBack"), this.mainMenu.active = !0, this.gameScene.active = !1, this.endLess.active = !1, this.curLevel = 1, this.curScore = 0
            },
            gameBack2: function () {
                cc.log("popstar gameBack2"), this.mainMenu.active = !0, this.gameScene.active = !1, this.endLess.active = !1, this.curLevel = 1, this.curScore = 0
            },
            gameRetry: function () {
                cc.log("popstar gameRetry"), this.mainMenu.active = !1, this.gameScene.active = !0, this.endLess.active = !1, this.createAllCube()
            },
            createAllCube: function () {
                this.clearGame(), this.node.on(cc.Node.EventType.TOUCH_END, function (e) {
                    this.resetCubeState(e)
                }, this), cc.log("createAllCube curLevel:" + this.curLevel + " colorType:" + this.colorType), this.labelLevel.string = "\u5f53\u524d\u5173\u5361 " + this.curLevel, this.totalScore = this.getTargetScoreByColorType(), this.labelTotalScore.string = "\u76ee\u6807\u5206\u6570 " + this.totalScore, this.labelScore.string = "\u5f53\u524d\u5206\u6570 " + this.curScore;
                for (var e = cc.find("Canvas/Game/allCube"), t = 0; t < this.rowNum; t++) {
                    this.allCube[t] = [], this.posMatrix[t] = [];
                    for (var o = 0; o < this.colNum; o++) {
                        this.posMatrix[t][o] = cc.v2(this.lowerLeft.x + this.cubeWidth * o, this.lowerLeft.y + this.cubeHeight * t);
                        var c = cc.instantiate(this.cubePrefab);
                        c.width = this.cubeWidth, c.height = this.cubeHeight, c.parent = e, c.position = this.posMatrix[t][o];
                        var s = c.getComponent("wss_ps_Cube"),
                            n = Math.random() * this.colorType | 0;
                        s.setCubeType(n, t, o), this.allCube[t][o] = c
                    }
                }
            },
            resetCubeState: function (e) {
                if (cc.log("resetCubeState"), this.removeCount = 0, console.log("currentStatus=" + this.currentStatus), "delete" == this.currentStatus && "1" == this.deleteBtn.node.getChildByName("deleteLabel").getComponent(cc.Label).string) {
                    for (var t = 0; t < this.rowNum; t++)
                        for (var o = 0; o < this.colNum; o++) {
                            var c = this.allCube[t][o];
                            if (null != c) c.getComponent("wss_ps_Cube").resetState()
                        }
                    var s = e.target;
                    this.curType = s.getComponent("wss_ps_Cube").cubeType, s.getComponent("wss_ps_Cube").willRemove = !0, this.removeCount = 1, this.removeOneCube(s), this.deleteBtn.node.getChildByName("deleteLabel").getComponent(cc.Label).string = 0, this.deleteBtn.instantiate = !1, this.currentStatus = null
                } else if ("change" == this.currentStatus && "1" == this.changeBtn.node.getChildByName("changeLabel").getComponent(cc.Label).string) {
                    (s = e.target).getComponent("wss_ps_Cube").change(this.colorType), this.changeBtn.node.getChildByName("changeLabel").getComponent(cc.Label).string = 0, this.deleteBtn.instantiate = !1, this.currentStatus = null
                } else {
                    for (var n = 0; n < this.rowNum; n++)
                        for (var i = 0; i < this.colNum; i++) {
                            var r = this.allCube[n][i];
                            if (null != r) r.getComponent("wss_ps_Cube").resetState()
                        }
                    var l = (s = e.target).getComponent("wss_ps_Cube");
                    null != l && (this.curType = l.cubeType, this.retrieval(l.cubeRow, l.cubeCol), this.removeCube())
                }
            },
            retrieval: function (e, t) {
                if (!(e < 0 || e >= this.rowNum || t < 0 || t >= this.colNum)) {
                    var o = this.allCube[e][t];
                    if (null != o) {
                        var c = o.getComponent("wss_ps_Cube");
                        c.alreadyRet || (c.alreadyRet = !0, c.cubeType == this.curType && (c.willRemove = !0, this.removeCount++, this.retrieval(e, t - 1), this.retrieval(e, t + 1), this.retrieval(e + 1, t), this.retrieval(e - 1, t)))
                    }
                }
            },
            removeOneCube: function (e) {
                cc.log("removeCube --------\x3e removeCount:" + this.removeCount), cc.log("removeCube --------\x3e removeCount:" + e.getComponent("wss_ps_Cube").cubeRow), cc.log("removeCube --------\x3e removeCount:" + e.getComponent("wss_ps_Cube").cubeCol), this.hasVoice && cc.audioEngine.play(this.deleteOnce, !1, 1), e.destroy(), this.allCube[e.getComponent("wss_ps_Cube").cubeRow][e.getComponent("wss_ps_Cube").cubeCol] = null, this.moveDown(), this.moveBottomCenter(), this.realMove()
            },
            removeCube: function () {
                if (cc.log("removeCube --------\x3e removeCount:" + this.removeCount), !(this.removeCount <= 1)) {
                    this.addScore(this.removeCount), this.hasVoice && cc.audioEngine.play(this.deleteOnce, !1, 1), this.removeCount >= 6 && this.removeCount <= 7 ? this.hasVoice && cc.audioEngine.play(this.audio6, !1, 1) : this.removeCount >= 8 && this.hasVoice && cc.audioEngine.play(this.audio8, !1, 1);
                    for (var e = 0; e < this.rowNum; e++)
                        for (var t = 0; t < this.colNum; t++) {
                            var o = this.allCube[e][t];
                            if (null != o) o.getComponent("wss_ps_Cube").willRemove && (o.destroy(), this.allCube[e][t] = null)
                        }
                    this.moveDown(), this.moveBottomCenter(), this.realMove()
                }
            },
            moveDown: function () {
                cc.log("moveDown");
                for (var e = 0; e < this.rowNum; e++)
                    for (var t = 0; t < this.colNum; t++) {
                        var o = e,
                            c = this.allCube[e][t];
                        if (null == c) {
                            for (; o < this.rowNum && null == (c = this.allCube[o][t]);) o++;
                            null != c && (this.allCube[e][t] = this.allCube[o][t], this.allCube[o][t] = null, this.allCube[e][t].getComponent("wss_ps_Cube").resetRowCol(e, t))
                        }
                    }
            },
            moveBottomCenter: function () {
                cc.log("moveBottomCenter");
                for (var e = 0; e < this.colNum; e++) {
                    if (null == this.allCube[0][e])
                        for (var t = e + 1; t < this.colNum; t++)
                            for (var o = 0; o < this.rowNum; o++) {
                                null != this.allCube[o][t] && (this.allCube[o][t - 1] = this.allCube[o][t], this.allCube[o][t] = null, this.allCube[o][t - 1].getComponent("wss_ps_Cube").resetRowCol(o, t - 1))
                            }
                }
                this.haveSpace() && (cc.log("haveSpace"), this.moveBottomCenter())
            },
            haveSpace: function () {
                for (var e = this.getLeftCol(), t = 0; t < e; t++) {
                    if (null == this.allCube[0][t]) return !0
                }
                return !1
            },
            getLeftCol: function () {
                for (var e = 0, t = 0; t < this.colNum; t++) {
                    null != this.allCube[0][t] && e++
                }
                return e
            },
            realMove: function () {
                var e = this;
                cc.log("realMove");
                for (var t = (this.colNum - this.getLeftCol()) * this.cubeWidth * .5, o = 0; o < this.rowNum; o++)
                    for (var c = 0; c < this.colNum; c++) {
                        null != this.allCube[o][c] && cc.tween(this.allCube[o][c]).to(.1, {
                            position: cc.v2(this.posMatrix[o][c].x + t, this.posMatrix[o][c].y)
                        }).start()
                    }
                cc.tween(this.node).delay(.2).call(function () {
                    e.gameOver()
                }).start()
            },
            gameOver: function () {
                var e = this;
                cc.log("gameOver");
                for (var t = 0; t < this.rowNum; t++)
                    for (var o = 0; o < this.colNum; o++) {
                        if (null != (b = this.allCube[t][o])) {
                            var c = b.getComponent("wss_ps_Cube"),
                                s = t + 1;
                            if (s < this.rowNum) {
                                var n = this.allCube[s][o];
                                if (null != n) {
                                    var i = n.getComponent("wss_ps_Cube");
                                    if (c.cubeType == i.cubeType) return
                                }
                            }
                            var r = o + 1;
                            if (r < this.colNum) {
                                var l = this.allCube[t][r];
                                if (null != l) {
                                    var a = l.getComponent("wss_ps_Cube");
                                    if (c.cubeType == a.cubeType) return
                                }
                            }
                        }
                    }
                if (this.curScore >= this.totalScore) {
                    for (var u = 0, h = 0; h < this.rowNum; h++)
                        for (var p = 0; p < this.colNum; p++) {
                            null != (b = this.allCube[h][p]) && u++
                        }
                    cc.log("\u8fc7\u5173\u5566\uff0c\u5206\u6570\u662f\uff1a" + this.curScore);
                    var g = 3e3 - 200 * u;
                    if (this.fullScore += this.curScore + g, this.curLevel++, this.gameStart(), 11 == this.curLevel) {
                        var f = 2 * Math.random() + 10;
                        this.labelNext.active = !0, this.labelNext.getComponent(cc.Label).string = "\u83b7\u5f97\u7ea2\u5305" + f.toFixed(2) + "\u5143"
                    } else this.labelNext.getComponent(cc.Label).string = "\u4e0b\u4e00\u5173", cc.tween(this.node).call(function () {
                        e.labelNext.active = !0
                    }).delay(1).call(function () {
                        e.labelNext.active = !1
                    }).start()
                } else {
                    for (var v = 0, m = 0; m < this.rowNum; m++)
                        for (var d = 0; d < this.colNum; d++) {
                            var b;
                            null != (b = this.allCube[m][d]) && v++
                        }
                    var C = 3e3 - 200 * v;
                    C < 0 && (C = 0), this.fullScore += this.curScore + C;
                    var y = !1,
                        _ = cc.sys.localStorage.getItem("bestScore");
                    if ("" == _ || null == _ ? (cc.sys.localStorage.setItem("bestScore", this.fullScore), _ = this.fullScore, y = !0) : Number(_) < Number(this.fullScore) && (cc.sys.localStorage.setItem("bestScore", this.fullScore), _ = this.fullScore, y = !0), this.endLess.getChildByName("bestScore").getComponent(cc.Label).string = _, this.endLess.getChildByName("currentScore").getComponent(cc.Label).string = this.fullScore, this.curScore = 0, this.fullScore = 0, this.node.off(cc.Node.EventType.TOUCH_END), this.mainMenu.active = !1, this.gameScene.active = !0, this.endLess.active = !0, this.endLess.getChildByName("record").active = !!y, cc.sys.platform == cc.sys.WECHAT_GAME) {
                        var S = new Array;
                        S.push({
                            key: "score",
                            value: String(_)
                        }), wx.setUserCloudStorage({
                            KVDataList: S,
                            success: function (e) {
                                console.log("ok success", e)
                            },
                            fail: function (e) {
                                console.log("fail " + e)
                            }
                        })
                    }
                }
            },
            clearGame: function () {
                for (var e = 0; e < this.rowNum; e++)
                    for (var t = 0; t < this.colNum; t++)
                        if (this.allCube[e] && this.allCube[e][t]) {
                            var o = this.allCube[e][t];
                            null != o && (o.destroy(), this.allCube[e][t] = null)
                        }
            },
            getTargetScoreByLevel: function (e) {
                var t = 0;
                return 1 == e ? t = 1e3 : 2 == e ? t = 2e3 : 3 == e ? t = 4e3 : 4 == e ? t = 5e3 : 5 == e ? t = 7e3 : 6 == e ? t = 8e3 : 7 == e ? t = 1e4 : 8 == e ? t = 13e3 : 9 == e ? t = 16e3 : e >= 10 && (t = 2e4 + 4500 * (e - 10)), cc.log("getTargetScoreByLevel score:" + t + " level:" + e), t
            },
            getTargetScoreByColorType: function () {
                var e = this.curLevel,
                    t = 800 * this.curLevel + 150 * this.curLevel * this.curLevel;
                return cc.log("getTargetScoreByColorType leve:" + e + " colorType:" + this.colorType + " score:" + t), t
            },
            addScore: function (e) {
                var t = 20 + 25 * (e - 2);
                this.toast.getComponent("Toast").show("\u8fde\u6d88\u5f97\u5206" + t), this.curScore += t, this.labelScore.string = "\u5f53\u524d\u5206\u6570 " + this.curScore
            }
        }), cc._RF.pop()
    }, {}]
}, {}, ["rank", "selectLevel", "setting", "voice", "wss_ps_Cube", "wss_ps_PopStar", "Toast"]);